package mspbots.data.tl.script.listener;

import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import mspbots.data.tl.script.service.ScriptService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Log4j2
@Service
@Component
@RequiredArgsConstructor
public class ScriptListenner {

    private final ScriptService scriptService;

    @RabbitListener(queues = "dataset.refresh.script")
    public void syncHubspotTicket(Long dataSetId) {
        scriptService.sync(dataSetId);
    }

}
